package main

import "fmt"

var fibMap map[int]int = map[int]int{}

func fib04(n int) int {
	switch {
	case n == 0 || n == 1:
		fibMap[n] = n
		return n
	case n < 0:
		panic("n is less than 0")
	}

	fibMap[n] = fib04(n-1) + fibMap[n-2]
	// delete(fibMap, n-3)

	return fibMap[n]
}

func main() {
	fmt.Println(fib04(13))
}
